{include file="layout/head"}
<body class="fixed-sidebar  gray-bg " style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i></div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear">
                                <span class="block m-t-xs" style="font-size:18px;">
                                <strong class="font-bold">{$sys_config.main_title}</strong>
                                </span>
                            </span>
                        </a>
                    </div>
                    <div class="logo-element">{$sys_config.main_title}</div>
                </li>
                <li class="line dk"></li>
                {$menu_view}
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <a class="navbar-minimalize minimalize-styl-2" href="#" title="展示收起侧栏"><i class="fa fa-outdent"></i>
                    </a>
                </div>
                <div class="navbar-module">
                    {$sys_config.top_links}
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <li><a href="{:url('admin/Store/apps')}"  class="J_menuItem" target="_blank"><i class="fa fa-fire"></i>应用</a></li>
                    <li><a href="http://www.07fly.xyz/" target="_blank"><i class="fa fa-home"></i>官网</a></li>
                    <li class="dropdown">
                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                            <i class="fa fa-chevron-down">{$sys_user_info['realname']}</i> </a>
                        <ul class="dropdown-menu dropdown-alerts">
                            <li>
                                <a data-url="{:url('SysUser/editInfo',array('id'=>$sys_user_info['id']))}"
                                   class="ajax-open" title="个人资料" data-calback="window.location.reload();">
                                    <div><i class="fa fa-envelope fa-fw"></i> 个人资料</div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <a href="{:url('SysUser/editPwd',array('id'=>$sys_user_info['id']))}" class="ajax-open"  title="个人资料">
                                    <div><i class="fa fa-qq fa-fw"></i> 密码修改</div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="text-center link-block"><a class="ajax-get" href="{:url('Login/logout')}" data-calback="window.location.reload();" >
                                    <strong>退出登录 </strong> <i class="fa fa-angle-right"></i> </a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe id="J_iframe" width="100%" height="95%" src="{:url('Index/main')}" frameborder="0"  data-id="index_v1.html" seamless></iframe>
        </div>
    </div>
    <!--右侧部分结束-->

</div>
<script>
    $(".navbar-module a").click(function () {
        $(this).addClass("on");
        $(this).siblings().removeClass('on');
    });
    $(document).ready(function () {
        var iframeUrl = localStorage.getItem('iframeUrl');
        if (typeof (iframeUrl) != "undefined" && iframeUrl != null) {

        } else {
            iframeUrl = "{:url('Index/main')}";
        }
        document.onkeypress = function (e) {
            if (e.keyCode == 116) {
                e.preventDefault(); //组织默认刷新
                iframe.src = iframeUrl;
            }
        }
        //刷新时设置当前点击页面数据
        if (typeof (iframeUrl) != "undefined") {
            that=$("a[href='"+iframeUrl+"']");
            //that.parent('li').addClass('active');
            that.parents('ul.nav').addClass('in');
            that.parents('ul.nav').parent('li').addClass('active');
            $('#J_iframe').attr('src', iframeUrl);//重新设置获取的url，实现刷新显示当前页面
        }

        //保存点击
        $(".J_menuItem").on('click', function () {
            var itemUrl = $(this).attr('href');
            console.log(iframeUrl);
            localStorage.setItem('iframeUrl', itemUrl);
        });

    });
</script>
{include file="layout/bottom"}
